import request from '@/utils/request'

// 获取合同分页接口
export function getContractPage(data) {
  return request({
    url: '/contract/queryPage',
    method: 'post',
    data
  })
}
// 分页查询合同下的需求 /contract/queryPageCo
export function getContractRequirementPage(data) {
  return request({
    url: '/contract/queryPageCo',
    method: 'post',
    data
  })
}

// 查询未关联的需求
export function getUnassociatedRequirementPage() {
  return request({
    url: '/contract/getNotAssociatedDe',
    method: 'get'
  })
}

// 新建合同
export function submitCreateContract(data) {
  return request({
    url: '/contract/create',
    method: 'post',
    data
  })
}
// /contract/getById 根据id查询合同详情
export function getContractDetail(params) {
  return request({
    url: '/contract/getById',
    method: 'get',
    params
  })
}
// 删除合同 /contract/remove?coId=1
export function deleteContract(params) {
  return request({
    url: '/contract/remove',
    method: 'get',
    params
  })
}
// 删除合同分支 /contract/removecd?coId=1&deId=1
export function deleteContractBranch(params) {
  return request({
    url: '/contract/removecd',
    method: 'get',
    params
  })
}
// 下载 /contract/download?coId=&deId=
export function downloadContract(params) {
  return request({
    url: '/contract/download',
    method: 'get',
    params
  })
}
